package com.yonyou.cyxdms.sysAuth.service.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * <p>
 *
 * </p>
 *
 * @author maxingjian
 * @since 2019-10-21
 */

public class MenuOperateLogDTO extends DMSBaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long menuLogId;
    /**
     * 菜单iD
     */
    private Long menuId;
    /**
     * 经销商公司id
     */
    private Long companyId;
    /**
     * 登录公司
     */
    private String ownerCode;
    /**
     * 组织
     */
    private Long userOrgId;
    /**
     * 操作时间
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime operateDate;
    /**
     * 操作员
     */
    private Long operator;
    /**
     * 备注
     */
    private String remark;
    private Boolean isDeleted;

    public MenuOperateLogDTO() {
        super();
    }


    public Long getMenuLogId() {
        return menuLogId;
    }


    public void setMenuLogId(Long menuLogId) {
        this.menuLogId = menuLogId;
    }


    public Long getMenuId() {
        return menuId;
    }


    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }


    public Long getCompanyId() {
        return companyId;
    }


    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }


    public String getOwnerCode() {
        return ownerCode;
    }


    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }


    public Long getUserOrgId() {
        return userOrgId;
    }


    public void setUserOrgId(Long userOrgId) {
        this.userOrgId = userOrgId;
    }


    public LocalDateTime getOperateDate() {
        return operateDate;
    }


    public void setOperateDate(LocalDateTime operateDate) {
        this.operateDate = operateDate;
    }


    public Long getOperator() {
        return operator;
    }


    public void setOperator(Long operator) {
        this.operator = operator;
    }


    public String getRemark() {
        return remark;
    }


    public void setRemark(String remark) {
        this.remark = remark;
    }


    public Boolean getDeleted() {
        return isDeleted;
    }


    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }


    @Override
    public String toString() {
        return "MenuOperateLogDTO{" +
                "menuLogId=" + menuLogId +
                ", menuId=" + menuId +
                ", companyId=" + companyId +
                ", ownerCode=" + ownerCode +
                ", userOrgId=" + userOrgId +
                ", operateDate=" + operateDate +
                ", operator=" + operator +
                ", remark=" + remark +
                ", isDeleted=" + isDeleted +
                "}";
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author maxingjian
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author maxingjian
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "menuLogId");
    }

}
